package com.daocao.hua.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * 交易类型数据模型
 */
public class DealTypeModel extends ResponseModel implements Parcelable {
    private int count;
    private List<DataList> data;


    public static class DataList implements Parcelable {
        private String banner;
        private String brief;
        private String id;
        private String maximum;
        private String minimum;
        private String name;
        private String repaytime;
        private String repaytime_type;
        private String repay_end_time;
        private String manage_fee;
        private String services_fee;
        private boolean inappliable;

        public String getManage_fee() {
            return manage_fee;
        }

        public void setManage_fee(String manage_fee) {
            this.manage_fee = manage_fee;
        }

        public String getRepay_end_time() {
            return repay_end_time;
        }

        public void setRepay_end_time(String repay_end_time) {
            this.repay_end_time = repay_end_time;
        }

        public String getBanner() {
            return banner;
        }

        public void setBanner(String banner) {
            this.banner = banner;
        }

        public String getBrief() {
            return brief;
        }

        public void setBrief(String brief) {
            this.brief = brief;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public boolean isInappliable() {
            return inappliable;
        }

        public void setInappliable(boolean inappliable) {
            this.inappliable = inappliable;
        }

        public String getMaximum() {
            return maximum;
        }

        public void setMaximum(String maximum) {
            this.maximum = maximum;
        }

        public String getMinimum() {
            return minimum;
        }

        public void setMinimum(String minimum) {
            this.minimum = minimum;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getRepaytime() {
            return repaytime;
        }

        public void setRepaytime(String repaytime) {
            this.repaytime = repaytime;
        }

        public String getRepaytime_type() {
            return repaytime_type;
        }

        public void setRepaytime_type(String repaytime_type) {
            this.repaytime_type = repaytime_type;
        }

        public String getServices_fee() {
            return services_fee;
        }

        public void setServices_fee(String services_fee) {
            this.services_fee = services_fee;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.banner);
            dest.writeString(this.brief);
            dest.writeString(this.id);
            dest.writeString(this.maximum);
            dest.writeString(this.minimum);
            dest.writeString(this.name);
            dest.writeString(this.repaytime);
            dest.writeString(this.repaytime_type);
            dest.writeString(this.repay_end_time);
            dest.writeString(this.manage_fee);
            dest.writeString(this.services_fee);
            dest.writeByte(this.inappliable ? (byte) 1 : (byte) 0);
        }

        public DataList() {
        }

        protected DataList(Parcel in) {
            this.banner = in.readString();
            this.brief = in.readString();
            this.id = in.readString();
            this.maximum = in.readString();
            this.minimum = in.readString();
            this.name = in.readString();
            this.repaytime = in.readString();
            this.repaytime_type = in.readString();
            this.repay_end_time = in.readString();
            this.manage_fee = in.readString();
            this.services_fee = in.readString();
            this.inappliable = in.readByte() != 0;
        }

        public static final Parcelable.Creator<DataList> CREATOR = new Parcelable.Creator<DataList>() {
            @Override
            public DataList createFromParcel(Parcel source) {
                return new DataList(source);
            }

            @Override
            public DataList[] newArray(int size) {
                return new DataList[size];
            }
        };

        @Override
        public String toString() {
            return "DataList{" +
                    "banner='" + banner + '\'' +
                    ", brief='" + brief + '\'' +
                    ", id='" + id + '\'' +
                    ", maximum='" + maximum + '\'' +
                    ", minimum='" + minimum + '\'' +
                    ", name='" + name + '\'' +
                    ", repaytime='" + repaytime + '\'' +
                    ", repaytime_type='" + repaytime_type + '\'' +
                    ", repay_end_time='" + repay_end_time + '\'' +
                    ", manage_fee='" + manage_fee + '\'' +
                    ", services_fee=" + services_fee +
                    ", inappliable=" + inappliable +
                    '}';
        }
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public List<DataList> getData() {
        return data;
    }

    public void setData(List<DataList> data) {
        this.data = data;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.count);
        dest.writeTypedList(this.data);
    }

    public DealTypeModel() {
    }

    protected DealTypeModel(Parcel in) {
        this.count = in.readInt();
        this.data = in.createTypedArrayList(DataList.CREATOR);
    }

    public static final Parcelable.Creator<DealTypeModel> CREATOR = new Parcelable.Creator<DealTypeModel>() {
        @Override
        public DealTypeModel createFromParcel(Parcel source) {
            return new DealTypeModel(source);
        }

        @Override
        public DealTypeModel[] newArray(int size) {
            return new DealTypeModel[size];
        }
    };
}
